﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;

namespace LightCAD.Core
{
    
    public interface IShape2dProvider
    {
        bool IsSupportCategory(string category);
        ComponentShape2d[] GetShapes(string category);
    }

    public class Shape2dProvider
    {
        public ComponentShape2dCollection Shapes { get; } = new ComponentShape2dCollection();
        public List<ComponentShape2d> List { get;} = new List<ComponentShape2d>();
        public Shape2dProvider() { }
        public void AddShapes(ComponentShape2d[] shapes)
        {
            List.AddRange(shapes);
            foreach(var shape in shapes)
            {
                if (!Shapes.Contains(shape.Name))
                {
                    Shapes.Add(shape);
                }
            }
        }
    }
}
